﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>流程评论</title>
</head>
<body onkeypress="Esc()">
    <script language="JavaScript" src="../Comm/JScript.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Scripts/bootstrap/js/jquery.min.js"></script>
    <script type="text/javascript" src="../Scripts/bootstrap/js/bootstrap.min.js"></script>
    <script src="../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../Scripts/config.js" type="text/javascript"></script>
    <script src="../Comm/Gener.js" type="text/javascript"></script>
    <base target="_self" />
    <link href="../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
     <style type="text/css">
       .table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th ,.table>colgroup+thead>tr:first-child>th
       {
           border: 1px solid rgb(221, 221, 221);
       }
    </style>
    <script language="javascript" type="text/javascript">
        var idx = 0;
        //页面启动函数.
        $(function () {
            $("#Msg").html("<img src=../../../Img/loading.gif />&nbsp;正在加载,请稍后......");
            InitPage();
            $("#Msg").html("");
        });

        var fk_flow = GetQueryString("FK_Flow");
        var workid = GetQueryString("WorkID");
        var fid = GetQueryString("FID");
        var fk_node = GetQueryString("FK_Node");

        //初始化数据.
        function InitPage() {
            var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
            handler.AddUrlData();
            var data = handler.DoMethodReturnString("Note_Init");

            if (data.indexOf('err@') == 0) {
                alert(data);
                return;
            }
            if (data == "[]") {
                return;
            }
            //转化成json.
            data = JSON.parse(data);
            var idx = 0;
            var currTrack=null;
            var _Html = "";
            for (var i = 0; i < data.length; i++) {
                var track = data[i];
                if (track.NDFrom == fk_node) {
                    currTrack = track;
                    continue;
                }
                idx = i + 1;
                _Html += "<tr>";
                _Html += "<td>" + idx + "</td>";
                _Html += "<td>" + track.NDFrom + "</td>";
                _Html += "<td>" + track.NDFromT + "</td>";
                _Html += "<td>" + track.EmpFromT + "</td>";
                _Html += "<td>" + track.RDT + "</td>";
                _Html += "<td>" + track.Msg + "</td>";
                _Html += "</tr>";
            }
            $("#NoteTbody").html(_Html);
            if (currTrack != null)
                $("#TB_Msg").val(currTrack.Msg);

        }
     
        function Submit() {

            if ($("#TB_Msg").val() == null || $("#TB_Msg").val() == "" || $("#TB_Msg").val().trim().length == 0) {
                alert("请填写备注信息!");
                return;
            }
           
            var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
            handler.AddUrlData();
            handler.AddPara("Msg", $("#TB_Msg").val());
            var data = handler.DoMethodReturnString("Note_Save");
            if (data.indexOf('err@') == 0) {
                alert(data);
                return;
            }
            window.location.href = window.location.href;
            
        }
      
    </script>
    <div align="center">
        <form id="cc" name="cc">
            <div style="height:80%;margin:5px 20px 0px 20px;">
                <table class="table table-hover" style="width:100%">
                    <caption>历史备注信息 </caption>
                    <thead>
                        <tr>
                            <th style='background-color:#F2F2F2;width:10px'>#</th>
                            <th style='background-color:#F2F2F2;;text-align:center'>节点</th>
                            <th style='background-color:#F2F2F2;;text-align:center'>节点名称</th>
                            <th style='background-color:#F2F2F2;;text-align:center'>处理人</th>
                            <th style='background-color:#F2F2F2;width:150px;text-align:center'>处理时间</th >
                            <th style='background-color:#F2F2F2;width:*;text-align:center'>备注信息</th>
                        </tr>
                    </thead>
                    <tbody id="NoteTbody">
                
                    </tbody>
                
                </table>
            </div>
            <div style="margin:5px 20px 0px 20px;">
                <table class="table table-hover" style="width:100%">
                 <caption>当前节点备注信息 </caption>
                 <tr>
                    <td>
                        <textarea rows="3" id="TB_Msg" name="TB_Msg" style="height:70px;width:98%"></textarea>
                    </td>
                </tr>
                </table>
            </div>
            <br />
            <input type="button" id="Btn_Save" name="Btn_Save" value="保存" onclick="Submit();" />
        
        </form>
        <div id="Msg">
        </div>
    </div>
    
</body>
</html>
